$(document).ready(function() {
	GoAdd();
});

function GoAdd() {
	$(".add").click(function() {
		window.location.href = "/AddNewPic?type=add";
	});
}


var app = new Vue({
	el: '.content',
	data() {
		var data = {};
		$.ajax({
			type: 'get',
			async: false,
			url: "/partner/getdata",
			success: function(datas) {
				var data_json =  eval('(' + datas + ')');  
				    data.IndustryData = data_json;
			}
		});
		return data;
	},
	methods: {
		DeleteStandard(e){//删除
			var el = e.currentTarget;
				this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					var that = this;
					var id= $(el).siblings("#xuhao").text();
					$.ajax({
						url: '/partner/delete',
						type: 'get',
						data: "id=" + id,
						cache: false,
						contentType: false, //不可缺参数
						processData: false, //不可缺参数
						success: function(datas) {
							$(el).parent().parent().parent().parent().parent().remove();//删除
							that.$message({
								type: 'success',
								message: '删除成功!'
							});
						}
					})
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消删除'
					});
				});
			},
		Jump: function(e) {
			var el = e.currentTarget;
			var href = $(el).text();
			//$(this).target = "_top";
			window.location.href = "http://" + href;
		},
		EditStandard(e){
			var el = e.currentTarget;
			var id= $(el).siblings("#xuhao").text();
			window.location.href = "/AddNewPic?type=edit&id="+ id;
		}
	}
});